package org.custom.spring.boot.datasource.service.impl;

import org.custom.spring.boot.datasource.entity.UserInfo;
import org.custom.spring.boot.datasource.service.UserInfoObtainService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;

/**
 * 默认的用户信息获取接口实现类
 *
 * @author 李坤
 * @date 2022/4/2 16:38
 */
@Service("simpleUserInfoObtainService")
@ConditionalOnMissingBean(UserInfoObtainService.class)
public class SimpleUserInfoObtainService implements UserInfoObtainService {

    @Override
    public UserInfo obtainUserInfo() {
        return UserInfo.builder().userId("admin").build();
    }

}
